#!/bin/sh

for i in $PLIBDIRS # $PLIBDIRS is exported in 2createpackages
do
	[ -d $i ] || continue
	#so did these, but needed...
	[ -e ${i}/libchromeXvMCPro.so.1 ] && ln -snf libchromeXvMCPro.so.1 ${i}/libchromeXvMCPro.so
	[ -e ${i}/libchromeXvMC.so.1 ] && ln -snf libchromeXvMC.so.1 ${i}/libchromeXvMC.so
	[ -e ${i}/libI810XvMC.so.1 ] && ln -snf libI810XvMC.so.1 ${i}/libI810XvMC.so
	[ -e ${i}/libIntelXvMC.so.1 ] && ln -snf libIntelXvMC.so.1 ${i}/libIntelXvMC.so
	#110623 mageia1 puts intel_drv.so in a strange place...
	if [ -f ${i}/xorg/modules/drivers/intel-common/intel_drv.so ];then
		mv -f ${i}/xorg/modules/drivers/intel-common/intel_drv.so ${i}/xorg/modules/drivers/
		rmdir ${i}/xorg/modules/drivers/intel-common
	fi
	#also has dri modules, but this is a cutdown pkg...
	rm -rf ${i}/xorg/modules/dri 2> /dev/null
done

#inrepid again. remove this, as xorg_base pkg has X as a symlink...
rm -f usr/bin/X 2>/dev/null
#arch, has extra servers in the one xorg-servers pkg...
rm -f usr/bin/Xnest  2> /dev/null
rm -f usr/bin/Xvfb   2> /dev/null
rm -f usr/bin/Xephyr 2> /dev/null
#100704 slackware 13.1, these X servers get through...
rm -f usr/bin/Xfbdev 2> /dev/null
rm -f usr/bin/Xsdl   2> /dev/null
rm -f usr/bin/Xdmx   2> /dev/null
rm -f usr/bin/Xfbdev 2> /dev/null
rm -f usr/bin/*dmx*  2> /dev/null

#110727 mageia1 creates /usr/bin/X symlink to Xwrapper, override...
ln -snf Xorg usr/bin/X
